<!DOCTYPE html>
<html>
<head>
<include file="Include:meta" />
<title>人员需求详情-目的地运营集团数据管理平台</title>
<include file="Include:style" />
<include file="Include:javascript" />
<style>
    .hidden{ display: none; }
    .meeting_cont.active{ padding-bottom: 70px }
    .cut{ padding-top: 46px; }
    .form_table td{ height: 24px; }
    .form_table .form_table_left{ min-width: 100px; }
    .form_table .form_table_left.active{ vertical-align: top; padding-top: 13px; }
    .two .sub_btn{ width: 30%; text-align: center; display: inline-block; margin: 10px 0; margin-right: 4%; line-height: 40px; height: 40px; }
    .two .dahui_btn{ background: #ff5879; }
	.two.three .sub_btn{ width: 25%; }
    .two .giveup_btn{ background: none; border: 1px solid #ccc; color: #666; }
    .two .sub_btn:last-child{ margin-right: 0; }
    .dahui_alert{ color: #333; }
    .form_label{ width: 80px; }
</style>
</head>
<body style="background: #f3f3f3;">
<div class="header">
	<a class="back_btn" href="__APP__/Mobile/Index/audit_list/type/{$type}"></a>
    人员需求详情
</div>
<div class="content">
    <div class="meeting_cont">
        <div class="cut_menu_line">
            <a class="active" href="javascript:;" uid="{$vo['uid']}" mid="{$result['id']}">需求详情<img src="__PUBLIC__/mobile/images/index/arrow_top.png" alt=""><span></span></a><a href="javascript:;" uid="{$vo['uid']}" mid="{$result['id']}">审核流程<img src="__PUBLIC__/mobile/images/index/arrow_top.png" alt=""><span></span></a>
        </div>
        <div class="cut">
            <div class="box">
                <div class="form_table all pb15 mb10">
                    <table cellspacing="0">
                        <tr>
                            <td class="form_table_left">申请单号</td>
                            <td class="form_table_right">{$result['order_number']}</td>
                        </tr>
                        <tr>
                            <td class="form_table_left">申请职位</td>
                            <td class="form_table_right">{$result['position_user']}</td>
                        </tr>
                        <tr>
                            <td class="form_table_left">申请人数</td>
                            <td class="form_table_right">{$result['number']}</td>
                        </tr>
                        <tr>
                            <td class="form_table_left">岗位职级</td>
                            <td class="form_table_right">{$result['rank']}</td>
                        </tr>
                        <tr>
                            <td class="form_table_left">汇报对象</td>
                            <td class="form_table_right">{$result['report_user']}</td>
                        </tr>
                        <tr>
                            <td class="form_table_left">岗位所属部门</td>
                            <td class="form_table_right"><div class="right_text">{$result['department_name']}</div></td>
                        </tr>
                        <tr>
                            <td class="form_table_left">是否关键岗位</td>
                            <td class="form_table_right">{$result['is_position']}</td>
                        </tr>
                        <tr>
                            <td class="form_table_left">申请部门</td>
                            <td class="form_table_right"><div class="right_text">{$result['sq_department_name']}</div></td>
                        </tr>
                        <tr>
                            <td class="form_table_left">申请人</td>
                            <td class="form_table_right">{$result['add_user']}</td>
                        </tr>
                        <tr>
                            <td class="form_table_left">申请人岗位</td>
                            <td class="form_table_right">{$result['sq_position_user']}</td>
                        </tr>
                        <tr>
                            <td class="form_table_left">申请日期</td>
                            <td class="form_table_right">{$result['sq_date']}</td>
                        </tr>
                        <tr>
                            <td class="form_table_left">申请原因</td>
                            <td class="form_table_right"><div class="right_text">{$result['sq_remark']}</div></td>
                        </tr>
                    </table>
                </div>
                <div class="person_list">
                    <div class="lis">
                        <div class="tit">岗位职责简述及工作时间占比（%）</div>
                        <p><if condition="$result['reason1'] eq NULL">无<else/>{$result['reason1']}</if></p>
                        <div class="file">是否后附材料
						<if condition="$result['file1'] eq '否'"><span class="float_r" style="color:#999">{$result['file1']}</span></if>
						<if condition="$result['file_url1'] neq NULL">
							<a href="{$result['file_url1']}">{$result['file_name1']}</a>
						</if>
						</div>
                    </div>
                    <div class="lis">
                        <div class="tit">岗位任职要求</div>
						<if condition="$result['requir1'] eq NULL and $result['requir2'] eq NULL and $result['requir3'] eq NULL and $result['requir4'] eq NULL and $result['requir5'] eq NULL and $result['reason2'] eq NULL">
							<p>无</p>
						<else/>
							<if condition="$result['requir1'] neq NULL or $result['requir2'] neq NULL or $result['requir3'] neq NULL or $result['requir4'] neq NULL or $result['requir5'] neq NULL">
							<div class="sec">基本要求：</div>
							<p>
                                <if condition="$result['requir1'] neq NULL">学历：{$result['requir1']}</if><br>
                                <if condition="$result['requir2'] neq NULL">专业：{$result['requir2']}</if><br>
                                <if condition="$result['requir3'] neq NULL">年龄：<if condition="$result['requir3'] neq NULL">{$result['requir3']} — {$result['requir4']}</if></if><br>
                                <if condition="$result['requir5'] neq NULL">性别：{$result['requir5']}</if></p>
							</if>
							<if condition="$result['reason2'] neq NULL">
							<div class="sec">基本要求：</div>
							<p>{$result['reason2']}</p>
							</if>
						</if>
                        <div class="file">是否后附材料
						<if condition="$result['file2'] eq '否'"><span class="float_r" style="color:#999">{$result['file2']}</span></if>
						<if condition="$result['file_url2'] neq NULL">
							<a href="{$result['file_url2']}">{$result['file_name2']}</a>
						</if>
						</div>
                    </div>
                    <div class="lis">
                        <div class="tit">关键业绩指标（KPI）</div>
                        <p><if condition="$result['reason3'] eq NULL">无<else/>{$result['reason3']}</if></p>
                        <div class="file">是否后附材料
						<if condition="$result['file3'] eq '否'"><span class="float_r" style="color:#999">{$result['file3']}</span></if>
						<if condition="$result['file_url3'] neq NULL">
							<a href="{$result['file_url3']}">{$result['file_name3']}</a>
						</if>
						</div>
                    </div>
                    <div class="lis">
                        <div class="tit">岗位客户<div class="las">岗位人员对接的对象（如人力资源部/招聘专员岗：对接各事业部人员等）</div></div>
                        
                        <p><if condition="$result['reason4'] eq NULL">无<else/>{$result['reason4']}</if></p>
                    </div>
                    <div class="lis">
                        <div class="tit">岗位出勤率<div class="las">说明同岗位已有人员前3~6个月出勤率情况/新增岗位填写无，需员工关系组确认</div></div>
                        
                        <p><if condition="$result['reason5'] eq NULL">无<else/>{$result['reason5']}</if></p>
                    </div>
                </div>
            </div>
            <div class="box hidden">
                <div class="person_list">
                    <ul>
						<if condition="$result['status'] neq -1">
							<foreach name="audit_user" item="vo">
								<li>
									<div class="tit">{$vo['audit_name']}：{$vo['audit_user']} <if condition="$vo['audit_date'] eq NULL"><span>[未审核]</span></if></div>
                                    <if condition="$vo['audit_date'] neq NULL">
										<div class="txt clearboth">
										<span><if condition="$key eq 0">提出申请<else />审核通过</if></span>
										<p>{$vo['audit_user']}({$vo['audit_date']|substr=0,10})<if condition="$key eq 0">发起申请<else /><if condition="$vo['audit_comments'] neq NULL">:{$vo['audit_comments']}</if></if></p>
										</div>
										<if condition="$vo['dh_message'] neq NULL"><div class="txt clearboth"><span class="gray">审核打回</span><p>打回至"{$vo['arrive_name']}"({$vo['dh_date']|substr=0,10})原因:{$vo['dh_message']}</p></div></if>
										<if condition="$vo['arrive_info'] neq NULL"><div class="txt clearboth"><p>"{$vo['arrive_name']}"({$vo['arrive_date']|substr=0,10})回复:{$vo['arrive_info']}</p></div></if>
									<else/>
										
										<if condition="$vo['dh_message'] neq NULL"><div class="txt clearboth"><span class="back">审核打回</span><p style="color:red;">打回至"{$vo['arrive_name']}"({$vo['dh_date']|substr=0,10})原因:{$vo['dh_message']}</p></div></if><if condition="$vo['arrive_info'] neq NULL"><div class="txt clearboth"><p style="color:red;">"{$vo['arrive_name']}"({$vo['arrive_date']|substr=0,10})回复:{$vo['arrive_info']}</p></div></if>
										
									</if>
								</li>
							</foreach>
                        </if>
                        <!--<if condition="$result['dh_uid'] neq NULL">
                        <li>
                            <div class="tit">打回原因</div>
                            <div class="txt clearboth"><p style="padding:0">{$result['dh_user']}({$result['dh_date']|substr=0,10}):{$result['dh_message']}</p></div>
                        </li>
						</if>
						<if condition="$result['submit_info'] neq NULL">
                        <li>
                            <div class="tit">重新提交</div>
                            <div class="txt clearboth"><p style="padding:0">{$result['submit_info']}</p></div>
                        </li>
						</if>-->
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<if condition="$result['status'] egt 0">
	<div class="build_btn text_c">
		<div class="two">
            <if condition="($qishen eq 1) and ($result['status'] neq 6)">
				<a class="sub_btn giveup_btn" status="{$result['status']}" stype="7" mid="{$result['id']}" href="javascript:;">弃审</a>
			</if>
			<if condition="($shenhe eq 1)">
                <a class="sub_btn dahui_btn" href="javascript:;" status="-1" mid="{$result['id']}" uuid="{$login_id}" active="2">打回</a>
				<a class="sub_btn audit_btn" href="javascript:;" status="{$result['status']}" mid="{$result['id']}" uuid="{$login_id}" active="1">审核</a>
			</if>
		</div>
	</div>
</if>
<!-- 弹出框 -->
<div class="Alert operate_alert audit_alert">
    <div>
        <p class="mb10">审核意见：</p>
        <textarea name="sh_text"></textarea>
        <div class="btn_box clearboth">
            <a class="btn_close float_l" href="javascript:;">取消</a><button class="btn_alert float_r disabled" disabled>确定</button>
        </div>
        <input class="size_input" type="hidden" sid="" tid="">
    </div>
</div>
<!-- 弹出框 -->
<div class="Alert operate_alert dahui_alert">
    <div>
        <p class="mb10">打回阶段</p>
        <div class="tab_btn">
			<foreach name="audit_list" item="vo"><a href="javascript:;" mid="{$vo['audit_sort']}">{$vo['audit_name']}</a></foreach>
        </div>
        <p class="mb10">是否重走流程</p>
        <div class="form_item mb20">
            <label class="form_label radio"><input type="radio" name="work_type" value="1">是</label>
            <label class="form_label radio"><input type="radio" name="work_type" value="-1">否</label>
        </div>
        <p class="mb10">打回原因</p>
        <textarea name="dh_text" style="height:100px" placeholder="请填写打回原因…"></textarea>
        <div class="btn_box clearboth">
            <a class="btn_close float_l" href="javascript:;">取消</a><button class="btn_alert float_r disabled" disabled>确定</button>
        </div>
        <input class="size_input" type="hidden" sid="" tid="">
    </div>
</div>
<script>
    $(function(){
        $('.cut_menu_line a').each(function(i){
            $(this).click(function(){
                $(this).addClass('active').siblings().removeClass('active');
                $('.box').eq(i).fadeIn().siblings().hide();
            })
        })
        $('.box .right_text').each(function(){
            var ht = $(this).height();
            if(ht>22){
                $(this).addClass('active');
                $(this).parents('tr').find('.form_table_left').addClass('active');
            }
        })
		var size = $('.sub_btn').size();
		if(size>0){
			$('.meeting_cont').addClass('active')
		}
		if(size>2){
			$('.two').addClass('three')
		}
        //弃审
        $(".giveup_btn").ajaxModal({"body_text":"您确定要弃审吗？","url":"/dms_erp/index.php?s=/Mobile/Index/audit_list_ajax","data":{"mid":"mid","status":"status","type":"stype"}});
        //审核
        $('.audit_btn').on("click",function(){
            var status = parseInt($(this).attr('status'))+1,
                uuid = $(this).attr("uuid"),
                state = 1,
                mid = $(this).attr("mid");
            Mask();
			if(status==6){
				$.ajax({
                    cache:true,
                    type:"POST",
                    dataType:"json",
                    url:"/dms_erp/index.php?s=/Mobile/Index/audit_list_ajax",
                    data:{"mid":mid,"status":status,"uuid":uuid,"state":state,"type":"7"},
                    success:function(data){
                        success_pop(data['status'],data['msg']);
                    }
                });
			}else{
				$('.audit_alert').fadeIn().find('textarea').val('').focus();
				$('.btn_alert').attr("status",status);
				$('.btn_alert').attr("uuid",uuid);
				$('.btn_alert').attr("mid",mid);
			}
        });
        //打回
        $('.dahui_alert .tab_btn a').click(function(){
            $(this).addClass('active').siblings().removeClass('active');
            submit();
        })
        $('.dahui_alert .form_label').click(function(){
            submit();
        })
        $(".dahui_btn").on("click",function(){
            var mid = $(this).attr("mid"),
                uuid = $(this).attr("uuid"),
                status = $(this).attr("status");
            Mask();
            $('.dahui_alert').fadeIn().find('textarea').val('');
            $('.btn_alert').attr("status",status);
            $('.btn_alert').attr("uuid",uuid);
            $('.btn_alert').attr("mid",mid);
        });
        //提交
        $('.audit_alert .btn_alert').click(function(){
            var status = $(this).attr('status'),
                uuid = $(this).attr("uuid"),
                state = 1,
                val = $(this).parents('.Alert').find('textarea').val(),
                mid = $(this).attr("mid"); 

            $.ajax({
                cache:true,
                type:"POST",
                dataType:"json",
                url:"/dms_erp/index.php?s=/Mobile/Index/audit_list_ajax",
                data:{"mid":mid,"status":status,"uuid":uuid,"state":state,"audit_message":val,"type":"7"},
                success:function(data){
                    success_pop(data['status'],data['msg']);
                }
            });
        })
        $('.dahui_alert .btn_alert').click(function(){
            var status = $(this).attr('status'),
                uuid = $(this).attr("uuid"),
                dh_status = "{$result['status']}",
                val = $(this).parents('.Alert').find('textarea').val(),
                btn = $(this).parents('.Alert').find('a.active').attr("mid"),
                lab = $(this).parents('.Alert').find('input:checked').val(),
                mid = $(this).attr("mid"); 
            
            $.ajax({
                cache:true,
                type:"POST",
                dataType:"json",
                url:"/dms_erp/index.php?s=/Mobile/Index/audit_list_ajax",
                data:{"mid":mid,"status":status,"flow_status":lab,"arrive_status":btn,"uuid":uuid,"dh_message":val,"dh_status":dh_status},
                success:function(data){
                    success_pop(data['status'],data['msg']);
                }
            });
        })
        //打回提交
		function submit(){
            var tag = true;
			
			if($('.tab_btn .active').length<1){
				tag = false;
                $('.dahui_alert .btn_alert').addClass('disabled').attr('disabled',true);
			}
            if($('.form_item .active').length<1){
				tag = false;
                $('.dahui_alert .btn_alert').addClass('disabled').attr('disabled',true);
			}
			$("[name='dh_text']").each(function(){
				if($(this).val()==''){
					tag = false;
					$('.dahui_alert .btn_alert').addClass('disabled').attr('disabled',true);
				}
			})
            if(tag){
                $('.dahui_alert .btn_alert').removeClass('disabled').attr('disabled',false);
            }
        }
        $("[name='dh_text']").bind('input propertychange', function() {
            var val = $(this).val();
            if(val!=''){
                submit();
            }else{
                $(".btn_alert").addClass("disabled").attr('disabled',true);
            }
        })
        $('.dahui_alert .btn_close').click(function(){
            $('.dahui_alert').find('.active').removeClass('active');
            $('.dahui_alert').find("[name='work_type']").attr("ckecked",false);
            $('.dahui_alert').find("textarea").val('');
            $('.dahui_alert .btn_alert').addClass('disabled').attr('disabled',true);
        })
        $('.audit_alert .btn_close').click(function(){
            $('.audit_alert').find("textarea").val('');
            $('.audit_alert .btn_alert').addClass('disabled').attr('disabled',true);
        })
        $("[name='sh_text']").bind('input propertychange', function() {  
            var val = $(this).val();
            if(val!=''){
                $('.audit_alert .btn_alert').removeClass('disabled').attr('disabled',false);
            }else{
                $(".audit_alert .btn_alert").addClass("disabled").attr('disabled',true);
            }
        })
    })
</script>
</body>
</html>